package com.study.dao;

import com.study.domain.Role;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by think on 2016/7/28.
 */
@Repository
public class RoleDao {
    @Resource
    private JdbcTemplate jdbcTemplate;

    public List<Role> getRoles(int id){
        String sql = "SELECT * from tb_url where parent_id = ? ";
        List<Role> list = jdbcTemplate.query(sql, new Object[]{id}, new Role());
        return  list;
    }
}
